package com.example.databindingtest.adapter

import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.databinding.DataBindingUtil
import androidx.recyclerview.widget.RecyclerView
import com.example.databindingtest.R
import com.example.databindingtest.databinding.ItemOnSellBinding
import com.example.databindingtest.domain.OnSellItem

/*
 * class title: 
 * Author by RenChunLin, Email 18957806320@163.com, Date on 2021/4/30.
 * PS: Not easy to write code, please indicate.
 */
public class OnSellListAdapter : RecyclerView.Adapter<OnSellListAdapter.InnerHolder>() {

    private val mContentList by lazy {

    }

    class InnerHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {

    }

    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): InnerHolder {
        val inflate =
            LayoutInflater.from(parent.context)
        val itemBinding = DataBindingUtil.inflate<ItemOnSellBinding>(
            inflate,
            R.layout.item_on_sell,
            parent,
            false
        )
        return InnerHolder(itemBinding.root)
    }

    override fun onBindViewHolder(holder: InnerHolder, position: Int) {

    }

    override fun getItemCount() = 30

    fun setData(it: MutableList<OnSellItem>?) {
        TODO("Not yet implemented")
    }

}